fix: Multi-task plan processing and model compatibility improvements (v0.1.2)#4
Merged
fix: Multi-task plan processing and model compatibility improvements (v0.1.2)#4
Conversation
BREAKING FIX: The ghcralph run --file PLAN.md command now correctly processes all pending tasks in a plan file sequentially instead of exiting after just the first task. Changes: - Add outer while loop for multi-task iteration in run.ts - Create fresh AI agent instance per task (Ralph pattern) - Add --pause-between-tasks flag for strict Ralph mode - Add task-level retry with configurable maxRetriesPerTask - Add createTaskCheckpoint() and createFailureCheckpoint() methods - Add pushToRemote() method to GitBranchManager - Add loadPreviousTaskResults() and appendTaskResult() to ProgressTracker - Add reload() method to PlanManager interface - Add HONESTY_GUIDANCE to prompt template - Add [ACTION:STUCK] action type for graceful failure signaling - Add waitForKeypress() utility function - Add maxRetriesPerTask and autoPush config options This implements Option A from LOOP_MAJOR_BUG_REMEDIATION_PLAN.md
- Add listAvailableModels() to CopilotAgent using SDK's listModels API - Add static fetchAvailableModels() for use without agent initialization - Update ghcralph init to dynamically fetch models from Copilot SDK - Fall back to hardcoded list if SDK fetch fails - Add parameterized model compatibility tests for response parsing - Test CREATE, EDIT, EXECUTE, COMPLETE, STUCK action variations - Export ModelInfo type from integrations module Addresses model list discrepancy between hardcoded init options and actual Copilot SDK available models. Tests: 305 passing
- Add multi-task processing feature to README - Add --pause-between-tasks flag to Advanced Run Options - Add maxRetriesPerTask and autoPush to Configuration Options - Update Key Features list - Document STUCK action in architecture.md - Add multi-task processing section to cookbook.md - Add STUCK troubleshooting to cookbook.md - Update Identified Issues table with fixed items
- Prefix unused parameter with underscore (_currentDefault) - Add explicit return types to async mock functions
rpothin
added a commit
that referenced
this pull request
Jan 28, 2026
…gy, failure warning Issue #4: Enhanced prompt engineering for honesty - Added HONESTY_GUIDANCE section to context-builder with completion integrity rules - Added STUCK_EXAMPLE to prompt-examples showing proper stuck action format - Updated FORMAT_INSTRUCTIONS and MINIMAL_EXAMPLES to include STUCK action - Added failure warning in ActionExecutor when COMPLETE used despite failed commands Issue #2: Git push implementation with configurable pushStrategy - Added pushStrategy config option: 'per-task' | 'per-run' | 'manual' - per-task (default): Push after each task completes - per-run: Push once at the end of the run - manual: No automatic push Files modified: - src/core/context-builder.ts - HONESTY_GUIDANCE enhancement - src/core/prompt-examples.ts - STUCK_EXAMPLE and format updates - src/core/action-executor.ts - Failed command tracking and warning - src/core/config-schema.ts - pushStrategy option - src/commands/run.ts - pushStrategy implementation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes a critical bug in
ghcralph runand adds model compatibility improvements, preparing for v0.1.2 release to npm.🐛 Critical Bug Fix: Multi-Task Plan Processing
Problem:
ghcralph run --file PLAN.mdonly processed the first task then exited, insteadof processing all pending tasks in the plan file.
Root Cause: The
runcommand had no outer loop to continue processing remaining tasks afterthe first task completed.
Solution (Option A from remediation plan):
while (currentTask)loop that processes ALL pending tasksmaxRetriesPerTask(default: 2)✨ New Features
--pause-between-tasksmaxRetriesPerTaskconfigautoPushconfig[ACTION:STUCK]ghcralph initnow fetches available models from Copilot SDK🔧 Technical Changes
Core Multi-Task Loop (
src/commands/run.ts)createTaskCheckpoint()andcreateFailureCheckpoint()loadPreviousTaskResults()andappendTaskResult()Prompt Engineering (
src/core/context-builder.ts)HONESTY_GUIDANCEsection encouraging agents to document blockers instead of falsecompletion claims
New STUCK Action (
src/core/response-parser.ts,src/core/action-executor.ts)Model Compatibility (
src/integrations/copilot-agent.ts,src/commands/init.ts)listAvailableModels()and staticfetchAvailableModels()using SDK'slistModels()API
ghcralph initdynamically fetches models instead of hardcoded list📁 Files Changed (24 files, +1924/-159 lines)
Core Changes:
src/commands/run.ts- Core multi-task loop fixsrc/commands/init.ts- Dynamic model fetchingsrc/core/config-schema.ts- New config optionssrc/core/checkpoint-manager.ts- Task-level checkpointssrc/core/git-branch-manager.ts- Push to remotesrc/core/progress-tracker.ts- Multi-task progress trackingsrc/core/context-builder.ts- Honesty guidance in promptsrc/core/response-parser.ts- STUCK action typesrc/core/action-executor.ts- STUCK action handlingsrc/integrations/copilot-agent.ts- Model listing methodsTests:
src/core/model-compatibility.test.ts- New parameterized tests (17 test cases)src/integrations/copilot-agent.test.ts- listModels testsDocumentation:
README.md- Updated features, config options, run optionsdocs/architecture.md- STUCK action, updated issues tabledocs/cookbook.md- Multi-task processing, STUCK troubleshooting✅ Validation
npm run typecheck✅npm test✅ (305 tests passing, +20 new tests)npm run build✅📚 Documentation Updates
--pause-between-tasks, new config options🔗 Related